<?php
namespace app\index\controller;
use think\Controller;
class Index extends Controller
{
    public function index()
    {
        $menber_id = session('id');
        $shop = db('cat')->alias('a')->join('shoper b','a.id=b.cat_id')->where('cat_id',2)->limit(8)->select();
        $tea_set = db('cat')->alias('a')->join('shoper b','a.id=b.cat_id')->where('cat_id',7)->limit(8)->select();
        $count = db('shopcar')->where('menber_id',$menber_id)->count();

        $shopcar = db('shopcar')->where('menber_id',$menber_id)->select();
        $this->assign('shopcar',$shopcar);
        $this->assign('count',$count);
        $this->assign('shop',$shop);
        $this->assign('tea_set',$tea_set);
       
        return view();
    }
    public function index1()
    {
        $menber_id = session('id');
        $shop = db('cat')->alias('a')->join('shoper b','a.id=b.cat_id')->where('cat_id',2)->limit(8)->select();
        $tea_set = db('cat')->alias('a')->join('shoper b','a.id=b.cat_id')->where('cat_id',7)->limit(8)->select();
        $count = db('shopcar')->where('menber_id',$menber_id)->count();

        $shopcar = db('shopcar')->where('menber_id',$menber_id)->select();
        $this->assign('shopcar',$shopcar);
        $this->assign('count',$count);
        $this->assign('shop',$shop);
        $this->assign('tea_set',$tea_set);
        return view();
    }
}
